import React, { Component } from "react";
import { Card } from 'antd';
const { Meta } = Card;
export default class List extends Component {

    render() {
        const { users, isFirst, isLoading, err } = this.props
        return (
            <div>
                {
                    isFirst ? <h2>欢迎使用，输入关键词，随后点击搜索</h2>:
                    isLoading ? <h2>正在加载中</h2>:
                    err ? <h2>{err}</h2>:
                    users.map(u => {
                        return  <Card
                         key={u.id}
                         hoverable
                         style={{ width: '19%' }}
                         className="card-item-style"
                         cover={<img alt="example" src={u.avatar_url}/>}
                       >
                         <Meta title="u.login" />
                         <a href={u.html_url}>{u.html_url}</a>
                       </Card>
                    })
                }
            </div>
        )
    }
}